The Label control is used to display text on a page.
<asp:Label ID="Label1" runat="server" Text="Hello"></asp:Label>
The id attribute is used to uniquely identify the <asp: label> control so you can refer to it in your ASP.NET code. The runat="server" attribute tells the server to process the control and generate HTML code to be sent to the client.
Properties
Property |
Description |
Text |
The text to display in the label |
ToolTip |
The text that appears when the user rests the mouse pointer over a control |
Here ‘Welcome’ is ToolTip, which user will if mouse pointer is over it. You can set this by using ToolTip property of Label Control.
Likewise we can also set its other properties like fore color, font, width, height etc.
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Italic="True"
Font-Size="Larger" ForeColor="#FF33CC" Text="Label"></asp:Label>
Leave Comment